package org.springblade.modules.enterprise.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.modules.enterprise.service.IIndexService;
import org.springblade.modules.enterprise.vo.BackIndexVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@AllArgsConstructor
@Api(value = "首页信息展示", tags = "首页信息展示")
@RequestMapping("/index")
@RestController
public class IndexController {

	private IIndexService indexService;

	@ApiOperation(value = "获取企业信息山完善度", notes = "")
	@GetMapping("/all-info")
	public R<BackIndexVO> getIndexInfo(@ApiParam("企业账户") @RequestParam("account") String account) {
		BackIndexVO indexInfo = indexService.getIndexInfo(account);
		return R.data(indexInfo);
	}
	@ApiOperation(value = "获取企业信息山完善度", notes = "")
	@GetMapping("/getIndexInfoForApp")
	public R getIndexInfoForApp(@ApiParam("企业账户") @RequestParam("account") String account) {
		float indexInfo = indexService.getIndexInfoForApp(account);
		return R.data(indexInfo);
	}
}
